/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package regiongenerator;

import java.util.LinkedList;
import java.util.List;
import regiongenerator.data.Interval;

/**
 *
 * @author grimmbo
 */
public class Constraints {

    public static List<Integer> getFieldTypeConstraints(int type)
    {
        LinkedList<Integer> allowedTypes = new LinkedList<Integer>();
        
        if (type == 0)
        {
            allowedTypes.add(0);
            allowedTypes.add(1);
        }
        else if (type == 1)
        {
            allowedTypes.add(0);
            allowedTypes.add(1);
            allowedTypes.add(2);
        }
        else if (type == 2)
        {
            allowedTypes.add(1);
            allowedTypes.add(2);
            allowedTypes.add(3);
            allowedTypes.add(4);
        }
        else if (type == 3)
        {
            allowedTypes.add(2);
            allowedTypes.add(3);
        }
        else if (type == 4)
        {
            allowedTypes.add(2);
            allowedTypes.add(4);
        }

        return allowedTypes;
    }


    public static Interval getFieldElevationConstraints(int elevation)
    {
        return new Interval(elevation-1, elevation+1);
    }
}
